package distributions;

import java.io.IOException;

public abstract class RandomStream
{
  private static final long uniformM = 100000000L;
  private static final long uniformB = 31415821L;
  private static final long uniformM1 = 10000L;
  private static final long two2the26th = 67108864L;
  private long MSeed;
  private long LSeed;
  private double[] series = new double[''];
  private static final long sizeOfSeries = 1024L;
  private static final long sizeOfDouble = 8L;

  public abstract double getNumber()
    throws IOException, ArithmeticException;

  public final double Error()
  {
    long l1 = 100L;
    long l2 = 100L * l1;
    long[] arrayOfLong = new long[100];
    for (int i = 0; i < l1; i++)
      arrayOfLong[i] = 0L;
    for (int i = 0; i < l2; i++)
      arrayOfLong[(int)(Uniform() * l1)] += 1L;
    long l3 = 0L;
    for (int j = 0; j < l1; j++)
      l3 += arrayOfLong[j] * arrayOfLong[j];
    double d1 = l1 * l3;
    double d2 = d1 / l2 - l2;
    return 1.0D - d2 / l1;
  }

  protected RandomStream()
  {
    this(772531L, 1878892440L);
  }

  protected RandomStream(long paramLong1, long paramLong2)
  {
    if ((paramLong1 & 1L) == 0L)
      paramLong1 -= 1L;
    if (paramLong1 < 0L)
      paramLong1 = -paramLong1;
    if (paramLong2 < 0L)
      paramLong2 = -paramLong2;
    this.MSeed = (paramLong1 % 67108864L);
    this.LSeed = (paramLong2 % 100000000L);
    for (int i = 0; i < 128L; i++)
      this.series[i] = MGen();
  }

  protected final double Uniform()
  {
    long l1 = this.LSeed % 10000L;
    long l2 = this.LSeed / 10000L;
    long l3 = 5821L;
    long l4 = 3141L;
    this.LSeed = ((((l1 * l4 + l2 * l3) % 10000L * 10000L + l1 * l3) % 100000000L + 1L) % 100000000L);
    long l5 = this.LSeed % 128L;
    double d = this.series[(int)l5];
    this.series[(int)l5] = MGen();
    return d;
  }

  private double MGen()
  {
    this.MSeed = (this.MSeed * 25L % 67108864L);
    this.MSeed = (this.MSeed * 25L % 67108864L);
    this.MSeed = (this.MSeed * 5L % 67108864L);
    return this.MSeed / 67108864.0D;
  }
}

/* Location:           /tmp/dlpjava/dlpjava.jar
 * Qualified Name:     distributions.RandomStream
 * JD-Core Version:    0.6.0
 */